Intersoft WebTextEditor Documentation
How-to: Remove Command using InitializeToolBar server-side event
See Also Send Feedback
Intersoft WebTextEditor > WebTextEditor > ToolBar > Customize toolbar programmatically from server-side > How-to: Remove Command using InitializeToolBar server-side event

Glossary Item Box

WebTextEditor provides a property to remove command during InitializeToolBar server side event.

In this topic, you will learn how to remove command.

To remove command during Server Side event

  1. Implement InitializeToolBar server side event in the WebTextEditor. Here is the snippet to remove the command using their name and position from the Standard toolbar:
    C# Copy Code
    protected void WebTextEditor1_InitializeToolBar(object sender, ISNet.WebUI.WebTextEditor.WebTextEditorToolBarArgs e)
    {  
       WebTextEditorToolBar tb = e.GetToolBarByCategory(WebTextEditorToolBarCategory.Standard);   
    
       WebTextEditorToolCommand cmdUndo = tb.ToolCommands.GetNamedItem("cmdUndo");  
       WebTextEditorToolCommand cmdRedo = tb.ToolCommands.GetNamedItem("cmdRedo");    
    
       tb.ToolCommands.RemoveAt(2);  
       tb.ToolCommands.Remove(cmdUndo);  
       tb.ToolCommands.Remove(cmdRedo);
    }
    

See Also

©2013. All Rights Reserved.